package com.lt.test.provider.mapper;

import com.lt.test.entity.DO.UserDO;
import com.lt.test.entity.DTO.CustomUser;
import com.lt.test.entity.QueryModel.PageQueryModel;

import java.util.List;

/**
 * 用户相关
 * @author zhengchuan
 *
 */
public interface UserMapper {
	/**
	 * 插入数据库
	 * @param user 要插入的对象
	 * @throws Exception
	 */
	void insertUser(UserDO user) throws Exception;
	/**
	 * 根据id删除用户
	 * @param userId
	 * @throws Exception
	 */
	void deleteUserById(String userId) throws Exception;
	/**
	 * 更新用户
	 * @param user
	 * @throws Exception
	 */
	//void updateUser(UserDO user) throws Exception;
	/**
	 * 根据id查找用户
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	UserDO findUserById(String userId)throws Exception;
	
	/**
	 * 根据用户phone获取到用户
	 * @param phone
	 * @return
	 */
	UserDO findUserByPhone(String phone) throws Exception;

	/**
	 * 分页查询用户
	 * @param pageQueryModel
	 * @return
	 * @throws Exception
	 */
    List<CustomUser> findUserByPage(PageQueryModel pageQueryModel) throws Exception;

	/**
	 * 查询用户总数
	 * @param pageQueryModel
	 * @return
	 * @throws Exception
	 */
	int getUserCount(PageQueryModel pageQueryModel) throws Exception;

    void editUserInfo(CustomUser user) throws Exception;


	void initializeUserPassword(UserDO user) throws Exception;

	CustomUser findCustomUserById(String userId) throws Exception;

    CustomUser findCustomByPhone(String username) throws Exception;
}
